package com.monkeygroup.mygoplus.http;

import android.content.Context;

import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.toolbox.Volley;

public class HttpRequestManager {


    private static RequestQueue mRequestQueue;

    /**
     * 初始化RequestQueue对象
     */
    public static void initRequestQueue(Context context) {

        if (mRequestQueue == null) {
            mRequestQueue = Volley.newRequestQueue(context);
        }

    }

    /**
     * 添加一个httpRequest对象到mRequestQueue中
     *
     * @param httpRequest
     */
    public static void addHttpRequest(Request<String> httpRequest) {

        if (httpRequest != null) {
            mRequestQueue.add(httpRequest);
        }

    }

}
